<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->string('name')->default('')->comment('商品名称');

            $table->integer('category_id')->unsigned()->default(0)->comment('分类id');

            $table->string('img',500)->default('')->comment('商品图片，多张，逗号隔开');

            $table->integer('status')->unsigned()->default(2)->comment('上架状态，1上架，2下架');

        });

        DB::statement("ALTER TABLE `goods` COMMENT='商品表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
